package com.pk.platform.business.common.web;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.pk.platform.business.common.service.IArrangeService;
import com.pk.platform.business.common.service.IChildService;
import com.pk.platform.business.common.vo.ChildArrangeVO;
import com.pk.platform.business.core.web.GenericAction;
import com.pk.platform.domain.common.Child;
import com.pk.platform.domain.common.ChildArrange;

public class ArrangeAction extends GenericAction {

	private IArrangeService arrangeService;
	
	private ChildArrange ca = new ChildArrange();

	private ChildArrangeVO cavo = new ChildArrangeVO();
	
	private Child child = new Child();
	
	private List<Map<String, Object>> caList = new ArrayList<Map<String, Object>>();
	
	private String childArrangeId;
	
	private IChildService childService;
	
	public String childArrangeManage()
	{
		child = childService.queryChildById(cavo.getChildId());
		return SUCCESS;
	}
	
	public String queryChildArrangeList()
	{
		caList = arrangeService.queryChildArrangeByTimeOfChild(cavo.getChildId(), cavo.getStart(), cavo.getEnd());
		return SUCCESS;
	}
	
	public String toAddChildArrange()
	{
		return SUCCESS;
	}
	
	public String addChildArrange()
	{
		arrangeService.addChildArrange(ca);
		return SUCCESS;
	}
	
	public String toUpdateChildArrange()
	{
		ca = arrangeService.queryChildArrangeById(ca.getId());
		return SUCCESS;
	}
	
	public String updateChildArrange()
	{
		arrangeService.updateChildArrange(ca);
		return SUCCESS;
	}
	
	public String delChildArrange()
	{
		arrangeService.delChildArrange(ca.getId());
		return SUCCESS;
	}
	

	public IArrangeService getArrangeService() {
		return arrangeService;
	}

	public void setArrangeService(IArrangeService arrangeService) {
		this.arrangeService = arrangeService;
	}

	public ChildArrange getCa() {
		return ca;
	}

	public void setCa(ChildArrange ca) {
		this.ca = ca;
	}

	public ChildArrangeVO getCavo() {
		return cavo;
	}

	public void setCavo(ChildArrangeVO cavo) {
		this.cavo = cavo;
	}

	public Child getChild() {
		return child;
	}

	public void setChild(Child child) {
		this.child = child;
	}

	public List<Map<String, Object>> getCaList() {
		return caList;
	}

	public void setCaList(List<Map<String, Object>> caList) {
		this.caList = caList;
	}

	public String getChildArrangeId() {
		return childArrangeId;
	}

	public void setChildArrangeId(String childArrangeId) {
		this.childArrangeId = childArrangeId;
	}

	public IChildService getChildService() {
		return childService;
	}

	public void setChildService(IChildService childService) {
		this.childService = childService;
	}
	
}
